<template>
    <view class="bg-white padding-bottom-30">
        <custom><template #backText>中营项目</template></custom>
        <view class="bg-gradual-nddyny" style="padding-bottom: 150rpx;">
            <view class="padding-top-40 padding-lr-30 flex align-center justify-between">
                <view>
                    <view class="text-xxl">我的账户</view>
                </view>
                <view class="bg-nddyny light round padding-lr-40 padding-tb-20">
                    <view class="text-black opacity7">
                        <text class="text-df">{{name}}</text>
                    </view>
                </view>
            </view>
        </view>
        <view class="bg-white margin-lr-30 shadow-warp radius padding-30" style="margin-top: -110rpx;">
            <view class="padding-lr-50 padding-top-20">
                <view class="flex justify-center text-center text-gray text-df">
                    <view class="flex-sub">已兑期权数量</view>
                    <view class="flex-sub">已兑期权次数</view>
                </view>
                <view class="flex justify-center text-center text-nddyny text-xl margin-top-10">
                    <view class="flex-sub">{{page.invest_gold_share_amount | floor}}</view>
                    <view class="flex-sub">{{page.invest_times || 0}}</view>
                </view>
            </view>
        </view>
        <nBar class="margin-top-20" title="相关日志" right_title="查看全部日志" right_uri="/user/asset/log"></nBar>
        <userAssetLogTimeline ref="userAssetLogTimeline" :parentForm="userAssetLog.form"></userAssetLogTimeline> 
    </view>
</template>

<script>
    import userAssetLogTimeline from '@/components/nddyny/userAssetLogTimeline.vue';
    export default {
        components: {
            userAssetLogTimeline,
        },
        data() {
            return {
                page: {
                    iu_no: '',
                    invest_times: 0,
                    invest_gold_share_amount: 0,
                    created_at: '',
                },
                name: '',
                data: {
                    form: {
                        invest_id: 0,
                    }
                },
                userAssetLog: {
                    form: {
                        action_types: '901',
                        action_ids: '0'
                    },
                },
            }
        },
        onLoad(params) {
            this.data.form.invest_id = params.invest_id;
            this.userAssetLog.form.action_ids = this.data.form.invest_id;
            this.name = params.name;
            this.pageInit();
        },
        methods: {
            pageInit() {
                this.$api.post(this, {
                    url: '/project/invest/myPage',
                    success: (Result) => {
                        if (this.$api.form.toast(this, Result)) return;
                        this.page = Result.result;
                    }
                });
            },
        },
    }
</script>
